package com.example.bmanliku;


import android.content.Context;

import androidx.annotation.NonNull;

import java.util.List;

/**
 * @description 文件列表Adapter
 */
public class FileAdapter extends BaseRecyclerAdapter<FileModel> {

    public FileAdapter(@NonNull Context context, List<FileModel> data)
    {
        super(context, R.layout.adapter_file, data, true);
    }

    @Override
    public void convert(BaseRecyclerAdapter.ViewHolder holder, FileModel fileModel, int position)
    {
        holder.setText(R.id.file_name, fileModel.getName());
        holder.setImageResource(R.id.file_img, fileModel.isDirectory() ? R.drawable.ic_file : R.drawable.ic_text);
    }
}
